In the formation of a video signal, it is of important significance to reprocess the incoming image. Due to the large amount of data of the original image, the image compression and decompression become very important steps in the process of video encoding in order to reduce transmission bandwidth. An appropriate and efficient encoding method may effectively reduce the data storage space and improve the transmission rate of data.
Motion JPEG is a video encoding standard based on intra-frame compression, which is widely used in consumer electronics or film and television media editing due to its advantages, such as low computation complexity, low requirement of system memory and easy post-editing. Huffman encoding is a variable length encoding method, which may give a short codeword to a symbol having a high occurrence rate and give a long codeword to a symbol having a low occurrence rate to achieve compression, so Huffman encoding is often used as a main Motion JPEG encoding method. Compared with the Huffman encoding, Canonical Huffman encoding only needs to simulate the establishment of a Huffman tree without establishing a Huffman tree, which accelerates the encoding speed and improves the utilization of system memory accordingly, so the Canonical Huffman encoding is actually widely used in the encoding. The current Motion JPEG encoding technology based on the Canonical Huffman encoding mainly encodes in two primary ways: one uses the same Huffman description table (usually described as standard Huffman description table) to encode each frame, with no use of the correlation between adjacent frames, so the compression result is not satisfactory; the other is to scan twice in the same frame to generate the Huffman description table of the current frame and encode based on the generated Huffman description table, but because of the need to scan twice, it costs much system overhead, and is not beneficial to practical application.